<template>
  <div>
    <div>
      <el-checkbox v-model="checked1">备选项1</el-checkbox>
      <el-checkbox v-model="checked2">备选项2</el-checkbox>
    </div>
    <div>
      <el-checkbox-group v-model="checkList" @change="getValue">
        <el-checkbox label="A"></el-checkbox>
        <el-checkbox label="B"></el-checkbox>
        <el-checkbox label="C" border></el-checkbox>
        <el-checkbox label="D" disabled border></el-checkbox>
      </el-checkbox-group>
    </div>
    <div>
      <el-checkbox-group
          v-model="checkedCities"
          :min="1"
          :max="2">
        <el-checkbox v-for="city in cities" :label="city" :key="city">{{city}}</el-checkbox>
      </el-checkbox-group>
    </div>

  </div>
</template>

<script>
const cityOptions = ['上海', '北京', '广州', '深圳'];
export default {
  data() {
    return {
      checked1: true,
      checked2: false,

      checkList: ['A','B'],

      checkedCities: ['上海', '北京'],
      cities: cityOptions,
    };
  },
  methods: {
    getValue(val) {
      console.log(val);
    },
  }
}
</script>

<style scoped>
div {
  margin: 10px;
}
</style>